/**
 * 
 */
package com.lazyshopkeeper.front.apiService.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.lazyshopkeeper.front.apiService.IVasService;
import com.taobao.api.ApiException;
import com.taobao.api.TaobaoClient;
import com.taobao.api.domain.ArticleUserSubscribe;
import com.taobao.api.request.VasSubscribeGetRequest;
import com.taobao.api.response.VasSubscribeGetResponse;

/**
 * @author xuyuqi
 *
 */
@Service
public class VasService implements IVasService {

	@Autowired
	private TaobaoClient client;
	
	@Override
	public List<ArticleUserSubscribe> getUserVasInfo(String nick, String articleCode) throws ApiException {
		VasSubscribeGetRequest req=new VasSubscribeGetRequest();
		req.setNick(nick);
		req.setArticleCode(articleCode);
		VasSubscribeGetResponse response = client.execute(req);
		return response==null?null:response.getArticleUserSubscribes();
	}

}
